﻿using Common.Contract.Paging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Contract
{
    /// <summary>
    /// Nomal response record
    /// </summary>
    public class ResponseRecord : IResponseRecord
    {

        public static ResponseRecord Default { get { return new ResponseRecord { ErrorMessage = "", IsSuccess = true }; } }
        public bool IsSuccess { get; set; }
        public string ErrorMessage { get; set; }
    }

    /// <summary>
    /// Search response record
    /// </summary>
    public class SearchResponseRecord<T> : ResponseRecord, ISearchResponseRecord<T> where T : class
    {
        public PageRecord Page { get; set; }
        public List<T> Records { get; set; }
    }

    /// <summary>
    /// Get response record
    /// </summary>
    public class RetrieveResponseRecord<T> : ResponseRecord, IRetrieveResponseRecord<T> where T : class
    {
        public T Record { get; set; }
    }
}
